feat: add platform stats, stream leaderboard and archiving - #901
feat: add platform stats, stream leaderboard and archiving#901Sabira2003 wants to merge 1 commit into
Conversation
|
@Hakimziyech18 is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Sabira2003 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR adds platform analytics endpoints and sender-controlled stream archiving.
Platform stats
Adds
GET /api/stats.Returns:
total_streamsactive_streamscompleted_streamscanceled_streamstotal_vested_by_assetfor USDC and XLMunique_sendersunique_recipientsStats reflect the current database state.
Adds 60-second caching.
Keeps the endpoint public without authentication.
Updates the frontend stats widget to consume
/api/stats.Stream leaderboard
Adds
GET /api/leaderboard.Supports:
top_senderstop_recipientslargest_streamsTop senders are ranked by total amount streamed.
Top recipients are ranked by total amount received.
Largest streams are ranked by
totalAmount.Supports a configurable
limit, defaulting to 10 and validated between 1 and 50.Adds 5-minute caching.
Adds
X-Cacheresponse headers for cache HIT/MISS visibility.Stream archiving
GET /api/streams?include_archived=truecontinues to return archived streams.Testing
git diff --cached --checkpasses.createStream()implementation inbackend/src/services/streamStore.ts.Closes #704
Closes #707
Closes #715